using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class ProductProductPhotoConfiguration : EntityTypeConfiguration<ProductProductPhoto>
    {
        public ProductProductPhotoConfiguration()
        {
            ToTable("Production.ProductProductPhoto");
            HasKey(x => new {x.ProductId, x.ProductPhotoId});

            Property(x => x.ProductId)
                .HasColumnName("ProductID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.ProductPhotoId)
                .HasColumnName("ProductPhotoID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.Primary).HasColumnName("Primary").IsRequired();
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}